package easy;

public class Solution_796 {

    public boolean rotateString(String s, String goal) {
        char[] chars = s.toCharArray();
        int length = chars.length;
        char[] array = new char[length << 1];
        System.arraycopy(chars, 0, array, 0, length);
        for (int i = 0; i < length; i++) {
            if (goal.equals(new String(array, i, length))) {
                return true;
            }
            array[length + i] = chars[i];
        }
        return false;
    }

    public static void main(String[] args) {
        Solution_796 model = new Solution_796();
        System.out.println(model.rotateString("abcde", "cdeab"));
        System.out.println(model.rotateString("abcde", "abced"));
    }
}
